package base.Day03;
// 你再这样我就要弹琴了
public class OperationDemo01
{
    public static void main(String[] args)
    {
        OperationDemo01 operationDemo01 = new OperationDemo01();
        operationDemo01.addAdd();
        System.out.println("--------------------------------");
        operationDemo01.subSub();
    }

    public void add()
    {

    }

    public void sub()
    {

    }

    public void multi()
    {

    }


    public void div()
    {

    }


    public void addAdd()
    {
//        ++ 使用规则  被使用  ++a相当于a+1       a++ 相当于 a
        int a = 1;
        int b = 2;
        int c = a++;   // 将a++赋值给c,同时a自增1
        int d = ++b;   // 将++b赋值给d,同是b自增1
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        System.out.println(d);
        int s = 33;
        System.out.println(s++);     // 执行输出s++， 同时将s自增一
        int y = 33;
        System.out.println(++y);    // 执行输出++y 同时将y自增一
    }

    public void subSub()
    {
        int a = 11;
        int b = 11;
        int c = --a;
        int d = b--;
        System.out.println("a= "+a);
        System.out.println("b= "+b);
        System.out.println("c= "+c);
        System.out.println("d= "+d);


    }
}





